//
//  BBSwichViewModel.m
//  BBKit
//
//  Created by apple on 2019/7/1.
//  Copyright © 2019年 baobao. All rights reserved.
//

#import "BBSwichViewModel.h"
#import "UIControl+Event.h"

#define BBKIT_SETPRAGRA_UISWITCH_API(methodName, paraType)    BBKIT_SETPRAGRA_API(methodName,paraType, UISwitch, BBSwichViewModel*)

@implementation BBSwichViewModel


BBKIT_SETPRAGRA_UISWITCH_API(on, BOOL);
BBKIT_SETPRAGRA_UISWITCH_API(onTintColor, UIColor *);
BBKIT_SETPRAGRA_UISWITCH_API(thumbTintColor, UIColor *);

BBKIT_SETPRAGRA_UISWITCH_API(onImage, UIImage *);
BBKIT_SETPRAGRA_UISWITCH_API(offImage, UIImage *);

#pragma mark - # UIControl
BBKIT_SETPRAGRA_UISWITCH_API(enabled, BOOL);
BBKIT_SETPRAGRA_UISWITCH_API(selected, BOOL);
BBKIT_SETPRAGRA_UISWITCH_API(highlighted, BOOL);

- (BBSwichViewModel *(^)(UIControlEvents controlEvents, void (^eventBlock)(id sender)))eventBlock
{
    return ^BBSwichViewModel *(UIControlEvents controlEvents, void (^eventBlock)(id sender)) {
        [(UIControl *)self.view addControlEvents:controlEvents handler:eventBlock];
        return self;
    };
}

@end
